//
//  YZMsRetweetView.swift
//  YZMweibo
//
//  Created by Simon on 16/4/21.
//  Copyright © 2016年 Simon. All rights reserved.
//

import UIKit

class YZMsRetweetView: UIView {
    
    var status: YZMStatus?{
        didSet{
            
            contentLabel.text = status?.retweeted_status?.text
        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    // MARK: - 设置视图
    private func setupUI(){
        self.backgroundColor = RGB(red: 237, green: 237, blue: 237)
        
        // 01- 添加控件
        addSubview(contentLabel)
        // 02- 添加约束
        contentLabel.snp_makeConstraints { (make) -> Void in
            make.leading.top.equalTo(self).offset(10)
            make.width.equalTo(ScreenW - 20)
        }
        
        
        self.snp_makeConstraints { (make) -> Void in
            make.bottom.equalTo(contentLabel.snp_bottom).offset(10)
        }
        
        // 测试
        // contentLabel.text = "转发微博正文转发微博正文转发微博正文转发微博正文转发微博正文转发微博正文转发微博正文"
        
    }
    
    
    // MARK: - 懒加载控件
    // 转发微博正文
    private lazy var contentLabel: UILabel = {
        let lab = UILabel(textColor: UIColor.blackColor(), textFont: 14)
        lab.numberOfLines = 0
        return lab
    }()
    
    
    
    
}
